#include <bits/stdc++.h>

using namespace std;
using ll=long long;
#define endl '\n'
const int maxn = 1000 + 10;
ll a[maxn], b[1001];
int n, m = 0;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    sort(a, a + n);
    m = unique(a, a + n) - a;
    cout << m << endl;
    for (int i = 0; i < m; i++) {
        cout << a[i] << " ";
    }
    cout << endl;
    return 0;
}
